// To parse this JSON data, do
//
//     final profileMo = profileMoFromJson(jsonString);

import 'dart:convert';

import 'banner_mo.dart';
import 'benefit_mo.dart';
import 'course_mo.dart';

ProfileMo profileMoFromJson(String str) => ProfileMo.fromJson(json.decode(str));

String profileMoToJson(ProfileMo data) => json.encode(data.toJson());

class ProfileMo {
  String name;
  String face;
  int fans;
  int favorite;
  int like;
  int coin;
  int browsing;
  List<BannerMo> bannerList;
  List<Course> courseList;
  List<Benefit> benefitList;

  ProfileMo({
    required this.name,
    required this.face,
    required this.fans,
    required this.favorite,
    required this.like,
    required this.coin,
    required this.browsing,
    required this.bannerList,
    required this.courseList,
    required this.benefitList,
  });

  factory ProfileMo.fromJson(Map<String, dynamic> json) => ProfileMo(
        name: json["name"],
        face: json["face"],
        fans: json["fans"],
        favorite: json["favorite"],
        like: json["like"],
        coin: json["coin"],
        browsing: json["browsing"],
        bannerList: List<BannerMo>.from(
            json["bannerList"].map((x) => BannerMo.fromJson(x))),
        courseList: List<Course>.from(
            json["courseList"].map((x) => Course.fromJson(x))),
        benefitList: List<Benefit>.from(
            json["benefitList"].map((x) => Benefit.fromJson(x))),
      );

  Map<String, dynamic> toJson() => {
        "name": name,
        "face": face,
        "fans": fans,
        "favorite": favorite,
        "like": like,
        "coin": coin,
        "browsing": browsing,
        "bannerList": List<dynamic>.from(bannerList.map((x) => x.toJson())),
        "courseList": List<dynamic>.from(courseList.map((x) => x.toJson())),
        "benefitList": List<dynamic>.from(benefitList.map((x) => x.toJson())),
      };
}
